﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace Cms.Core.Infrastructure.Ui
{
    public abstract  class ReturnResult<T> : IReturnResult<T>
    {

        protected ReturnResult() : this(new List<T>(), 0, "操作成功", true)
        {

        }
        protected ReturnResult(List<T> data, int total, string message = "操作成功", bool success = true)
        {
            this.Data = data;
            this.Total = total;
            this.Success = success;
            this.Message = message;
        }

        [JsonProperty("data")]
        public List<T> Data { get; set; }


        [JsonProperty("total")]
        public int Total { get; set; }
        [JsonProperty("success")]
        public bool Success { get; set; }
        [JsonProperty("message")]

        public string Message { get; set; }


    
    }
}
